<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增用户订单')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-order-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label">客户：</label>
                <div class="col-sm-8">
                    <select name="userId" class="form-control" th:with="users=${@view.getClients()}">
                        <option th:each="user : ${users}" th:text="${user.userName}" th:value="${user.userId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">套餐：</label>
                <div class="col-sm-8">
                    <select name="bagId" class="form-control" th:with="bags=${@view.getBags()}">
                        <option th:each="bag : ${bags}" th:text="${bag.bagName}" th:value="${bag.bagId}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单状态：</label>
                <div class="col-sm-8">
                    <select name="orderStatus" class="form-control m-b">
                        <option value="0">待选片</option>
                        <option value="1">待定片</option>
                        <option value="2">待取片</option>
                        <option value="6">已完成</option>
                        <option value="9">退订</option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">选片时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="choiceTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">定片时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="decideTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">取片时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="getTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control" maxlength="500"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "photograph/order"
        $("#form-order-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-order-add').serialize());
            }
        }

        $("input[name='choiceTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii",
            autoclose: true
        });

        $("input[name='decideTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii",
            autoclose: true
        });

        $("input[name='getTime']").datetimepicker({
            format: "yyyy-mm-dd hh:ii",
            autoclose: true
        });
    </script>
</body>
</html>